const { mapState } = Vuex
export default {
  template: `
  <el-menu mode="vertical" router>
    <el-submenu
      v-for="(submenus, index) in menulist"
      :index="index + 1"
      :key="submenus.id"
    >
      <template slot="title">{{submenus.authName}}</template>
      <el-menu-item
        v-for="(item, subIndex) in submenus.children"
        :index="item.path"
        :key="item.id"
      > 
        {{item.authName}}
      </el-menu-item>
    </el-submenu>
  </el-menu>
    `,
  data() {
    return {
      menulist: null,
    };
  },
  computed: {
    ...mapState(['rightList'])
  },
  created() {
    this.menulist = this.rightList
  },
}